﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using HZ.Supervise.Model;

namespace HZ.Supervise.BLL
{
    public class BLL_ProcureCatalog : HZ.Supervise.IBLL.IBLL_ProcureCatalog
    {
        /// <summary>
        /// 获取质量层次列表
        /// </summary>
        /// <returns></returns>
        public IList<string> GetQualityLevels()
        {
            return DAL.DAL_ProcureCatalog.GetQualityLevels();
        }
        /// <summary>
        /// 将药品信息插入 
        /// </summary>
        /// <param name="blackList">比例</param>
        /// <returns></returns>
        public int InsertIntoDistributionRatio(HZ.Supervise.Model.DistributionRatio distribution, HZ.Supervise.Model.DistributionRatioLog distributionLog)
        {
            return DAL.DAL_ProcureCatalog.InsertIntoDistributionRatio(distribution, distributionLog);
        }
        /// <summary>
        /// 批量更新全部数据
        /// </summary>
        /// <returns></returns>
        public int InsertIntoDistributionRatioAll(DistributionRatio distributionRation, DistributionRatioLog distributionRationLog, string where, int res)
        {
            return DAL.DAL_ProcureCatalog.InsertIntoDistributionRatioAll(distributionRation, distributionRationLog, where, res);
        }
        /// <summary>
        /// 批量更新与插入数据
        /// </summary>
        /// <param name="distributionRationList"></param>
        /// <param name="distributionRationLogList"></param>
        /// <returns></returns>
        public int InsertIntoDistributionRatioList(IList<DistributionRatio> distributionRationList, IList<DistributionRatioLog> distributionRationLogList)
        {
            return DAL.DAL_ProcureCatalog.InsertIntoDistributionRatioList(distributionRationList, distributionRationLogList);
        }
        /// <summary>
        /// 将药品信息更新
        /// </summary>
        /// <param name="blackList">比例</param>
        /// <returns></returns>
        public int UpdateIntoDistributionRatio(HZ.Supervise.Model.DistributionRatio distribution, HZ.Supervise.Model.DistributionRatioLog distributionLog)
        {
            return DAL.DAL_ProcureCatalog.UpdateIntoDistributionRatio(distribution, distributionLog);
        }
        /// <summary>
        /// 根据编号获取药品信息
        /// </summary>
        /// <param name="ProcureCatalogID"></param>
        /// <returns></returns>
        public Model.View.ProcureCatalog GetProcureCatalogByID(string ProcureCatalogID)
        {
            HZ.Common.ThrowHelper.Throw(!string.IsNullOrEmpty(ProcureCatalogID), "ProcureCatalogID不能空");
            return DAL.DAL_ProcureCatalog.GetProcureCatalogByID(ProcureCatalogID);
        }
        /// <summary>
        /// 根据条件查询出所有采购目录表中的数据并查询出补贴比例
        /// </summary>
        /// <param name="stwhere"></param>
        /// <param name="currentPage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalRecord"></param>
        /// <returns></returns>
        public DataTable GetScaleInfo(string stwhere, string areaId, int rel, int currentPage, int pagesize, out int totalRecord)
        {
            return DAL.DAL_ProcureCatalog.GetScaleInfo(stwhere, areaId, rel, currentPage, pagesize, out totalRecord);
        }
        /// <summary>
        /// 设置为或取消设置为贵重药品
        /// </summary>
        /// <param name="ProcureCatalogID">药品编码</param>
        /// <param name="IsPrecious">true设置为贵重药品,false取消设置为贵重药品</param>
        /// <returns>1成功0失败</returns>
        public int SetAsPreciousDrugs(IList<Model.Insurance> list)
        {
            return DAL.DAL_ProcureCatalog.SetAsPreciousDrugs(list);
        }
        /// <summary>
        /// 获取未被采购药品列表
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        public IList<Model.View.ProcureCatalog> GetUnTradeProcureCatalog(Model.Query.ProcureCatalog where, int currentpage, int pagesize, out int totalrecord)
        {
            return DAL.DAL_ProcureCatalog.GetUnTradeProcureCatalog(where, currentpage, pagesize, out totalrecord);
        }

        /// <summary>
        /// 获取贵重药品列表
        /// </summary>
        /// <param name="where"></param>
        /// <param name="isprecious">空:全部;true贵重药品;false非贵重药品;</param>
        /// <param name="currentpahe"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        public DataTable GetIsPreciousProcureCatalog(Model.Query.ProcureCatalog where, bool? isprecious, int currentpahe, int pagesize, out int totalrecord)
        {
            return DAL.DAL_ProcureCatalog.GetIsPreciousProcureCatalog(where, isprecious, currentpahe, pagesize, out totalrecord);
        }
        /// <summary>
        /// 获取未配送企业列表
        /// </summary>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        public DataTable GetUnDistributeCompanyList(HZ.Supervise.Model.Query.UnDistributeCompanyQuery where, int currentpage, int pagesize, out int totalrecord)
        {
            return DAL.DAL_ProcureCatalog.GetUnDistributeCompanyList(where, currentpage, pagesize, out totalrecord);
        }

        /// <summary>
        /// 获取未配送明细
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        public DataTable GetUnDistributeDetail(Model.Query.UnDistributeCompanyQuery where, int currentpage, int pagesize, out int totalrecord)
        {
            return DAL.DAL_ProcureCatalog.GetUnDistributeDetail(where, currentpage, pagesize, out totalrecord);
        }
        /// <summary>
        /// 查询采购目录信息
        /// </summary>
        /// <param name="productname"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        public DataTable GetProcureCatalog(string productname, string _sortId, int currentpage, int pagesize, out int totalrecord)
        {
            return DAL.DAL_ProcureCatalog.GetProcureCatalog(productname, _sortId, currentpage, pagesize, out totalrecord);
        }

        /// <summary>
        /// 条件查询采购目录信息（有效的【在采购项目有效期内】）
        /// </summary>
        /// <param name="procureCatalog">查询用实体</param>
        /// <param name="currentPage">当前页</param>
        /// <param name="pageSize">每页显示记录数</param>
        /// <param name="totalRecord">（输出参数）总记录数目</param>
        /// <returns>所有采购目录信息</returns>
        public IList<Model.View.ProcureCatalog> GetProcureCatalogByWhere(Model.Query.ProcureCatalog procurecatalog, int currentPage, int pageSize, out int totalRecord)
        {
            return DAL.DAL_ProcureCatalog.GetProcureCatalogByWhere(procurecatalog, currentPage, pageSize, out totalRecord);
        }
        /// <summary>
        /// 返回类别
        /// </summary>
        /// <param name="strsortname"></param>
        /// <returns></returns>
        public DataTable GetSort(string strsortname, int currentPage, int pagesize, out int totalRecord)
        {
            return DAL.DAL_ProcureCatalog.GetSort(strsortname, currentPage, pagesize, out  totalRecord);
        }

        /// <summary>
        /// 返回疾病种类
        /// </summary>
        /// <param name="strsortname"></param>
        /// <returns></returns>
        public DataTable GetPsympToms(string strwhere, int currentPage, int pagesize, out int totalRecord)
        {
            return DAL.DAL_ProcureCatalog.GetPsympToms(strwhere, currentPage, pagesize, out  totalRecord);
        }

        /// <summary>
        /// 配送率48小时统计（高值）
        /// </summary> 
        public DataTable GetCompanyRate(string strwhere, string timeform, string timeTo, string orderby, int currentPage, int pagesize, out int totalRecord)
        {
            return DAL.DAL_ProcureCatalog.GetCompanyRate(strwhere, timeform, timeTo, orderby, currentPage, pagesize, out totalRecord);
        }
        /// <summary>
        /// 配送率48小时统计（低值）
        /// </summary>   
        public DataTable GetCompanyRate_DZ(string strwhere, string timeform, string timeTo, string orderby, int currentPage, int pagesize, out int totalRecord)
        {
            return DAL.DAL_ProcureCatalog.GetCompanyRate_DZ(strwhere, timeform, timeTo, orderby, currentPage, pagesize, out totalRecord);
        }


        /// <summary>
        /// 条件查询采购目录信息（有效的【在采购项目有效期内】）
        /// </summary>
        /// <param name="procureCatalog">查询用实体</param>
        /// <param name="currentPage">当前页</param>
        /// <param name="pageSize">每页显示记录数</param>
        /// <param name="totalRecord">（输出参数）总记录数目</param>
        /// <returns>所有采购目录信息</returns>
        public DataTable GetProcureCatalogByWhere(HZ.Supervise.Model.View.ProcureCatalog procurecatalog, int currentPage, int pageSize, out int totalRecord)
        {
            return DAL.DAL_ProcureCatalog.GetProcureCatalogByWhere(procurecatalog, currentPage, pageSize, out totalRecord);

        }


        #region 参会相关
        /// <summary>
        /// 会议列表  
        /// </summary>  
        public DataTable GetMeetList(string str, int currentpage, int pagesize, out int totalrecord)
        {
            return DAL.DAL_ProcureCatalog.GetMeetList(str, currentpage, pagesize, out totalrecord);
        }
        /// <summary>
        /// 会议列表  
        /// </summary>  
        public DataTable GetMeetList2(string str)
        {
            return DAL.DAL_ProcureCatalog.GetMeetList2(str);
        }
        /// <summary>
        /// 新增/修改会议
        /// </summary>  
        public int AddMeet(Model.Meet mt)
        {
            return DAL.DAL_ProcureCatalog.AddMeet(mt);
        }
        /// <summary>
        /// 删除会议
        /// </summary>  
        public int DelMeet(string mids)
        {
            return DAL.DAL_ProcureCatalog.DelMeet(mids);
        }
        /// <summary>
        /// 参会人员列表  
        /// </summary>  
        public DataTable GetMeetInfoList(string str, int currentpage, int pagesize, out int totalrecord)
        {
            return DAL.DAL_ProcureCatalog.GetMeetInfoList(str, currentpage, pagesize, out totalrecord);
        }
        /// <summary>
        /// 参会人员列表（中心端） 
        /// </summary>   
        public DataTable GetMeetInfoListzbzx(string str, int currentpage, int pagesize, out int totalrecord)
        {
            return DAL.DAL_ProcureCatalog.GetMeetInfoListzbzx(str, currentpage, pagesize, out totalrecord);
        }
        /// <summary>
        /// 更新参会人员信息
        /// </summary> 
        public int UpdateCHRYInfo(HZ.Supervise.Model.MeetInfo hdl)
        {
            return DAL.DAL_ProcureCatalog.UpdateCHRYInfo(hdl);
        }
        /// <summary>
        /// 删除参会人员信息
        /// </summary>  
        public int DelCHRYInfo(string ids)
        {
            return DAL.DAL_ProcureCatalog.DelCHRYInfo(ids);
        }
        /// <summary>
        /// 医院列表  
        /// </summary>  
        public DataTable GetHosList(string str, string mid)
        {
            return DAL.DAL_ProcureCatalog.GetHosList(str, mid);
        }
        /// <summary>
        /// 保存医院参会人员信息  
        /// </summary>  
        public int SaveHosMeet(List<HZ.Supervise.Model.MeetInfo> list)
        {
            return DAL.DAL_ProcureCatalog.SaveHosMeet(list);
        }
        /// <summary>
        /// 获取已上报人数
        /// </summary>  
        public int GetHaveSubCount(string oid, string mid)
        {
            return DAL.DAL_ProcureCatalog.GetHaveSubCount(oid, mid);
        }
        /// <summary>
        /// 获取培训需求  
        /// </summary>  
        public DataTable GetPxContent(string oid, string mid)
        {
            return DAL.DAL_ProcureCatalog.GetPxContent(oid, mid);
        }
        /// <summary>
        /// 是否填写培训需求  
        /// </summary>  
        public int IsPxContent(string oid, string mid)
        {
            return DAL.DAL_ProcureCatalog.IsPxContent(oid, mid);
        }
        /// <summary>
        /// 判断会议报名时间是否过时  1过时 0未过时
        /// </summary>  
        public int IsBmGuoShi(string mid)
        {
            return DAL.DAL_ProcureCatalog.IsBmGuoShi(mid);
        }
        /// <summary>
        /// 获取培训需求（中心端） 
        /// </summary>   
        public DataTable GetPxContentzbzx(string str, int currentpage, int pagesize, out int totalrecord)
        {
            return DAL.DAL_ProcureCatalog.GetPxContentzbzx(str, currentpage, pagesize, out totalrecord);
        }
        /// <summary>
        /// 填写培训需求
        /// </summary>  
        public int SetPxContent(Model.MeetPxContent mt)
        {
            return DAL.DAL_ProcureCatalog.SetPxContent(mt);
        }
        #endregion

    }
}
